package com.wing.cabinet.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.cabinet.model.entity.CabinetCargoSpace;
import com.wing.cabinet.model.response.CabinetCargoSpaceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 收刀柜货位-Dao
 *
 * @author
 */
@Mapper
public interface CabinetCargoSpaceDao extends BaseMapper<CabinetCargoSpace> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<CabinetCargoSpaceVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<CabinetCargoSpaceVO> list4app(@Param("page") Page<CabinetCargoSpaceVO> page, @Param("params") Map<String, Object> params);

    List<CabinetCargoSpaceVO> list4MainCab(@Param("page") Page<CabinetCargoSpaceVO> page, @Param("params") Map<String, Object> params);

    List<CabinetCargoSpaceVO> list4Cab(@Param("page") Page<CabinetCargoSpaceVO> page, @Param("params") Map<String, Object> params);

    List<CabinetCargoSpaceVO> list4Load(@Param("page") Page<CabinetCargoSpaceVO> page, @Param("params") Map<String, Object> params);

    List<CabinetCargoSpaceVO> list4pc(@Param("page") Page<CabinetCargoSpaceVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    CabinetCargoSpaceVO get4appById(Long id);

    List<CabinetCargoSpaceVO> getUsableSpace(@Param("cabCodes")String[] cabCodes,@Param("businessType") Integer businessType,@Param("quantity") Integer quantity,@Param("skuCode") String skuCode
            ,@Param("spaceNature") Integer spaceNature,@Param("principal") Long principal,@Param("spaceProductType") Long spaceProductType);

    List<CabinetCargoSpaceVO> getUsedSpace(@Param("cabCodes")String[] cabCodes,@Param("businessType") Integer businessType,@Param("quantity") Integer quantity,@Param("skuCode") String skuCode
            ,@Param("spaceNature") String spaceNature,@Param("spaceNatureValue") Integer spaceNatureValue,@Param("principal") Long principal,@Param("spaceProductType") Long spaceProductType,@Param("creator")Long creator);

    List<CabinetCargoSpaceVO> getUsedSpace2(@Param("cabCodes")String[] cabCodes,@Param("spaceType") Integer spaceType,@Param("principal") Long principal,@Param("spaceProductType") Long spaceProductType,@Param("skuCode") String skuCode,@Param("skuCodeCurrent") String skuCodeCurrent,@Param("quantity") Integer quantity,@Param("businessType") Integer businessType);

    List<CabinetCargoSpaceVO> getUsedSpaceList(@Param("cabCodes")String[] cabCodes,@Param("businessType") Integer businessType,@Param("quantity") Integer quantity,@Param("skuCode") String skuCode
            ,@Param("spaceNature") Integer spaceNature,@Param("principal") Long principal,@Param("spaceProductType") Long spaceProductType,@Param("creator")Long creator);

    List<CabinetCargoSpaceVO> getEmptySpaces(@Param("cabCodes")String[] cabCodes,@Param("spaceNature") String spaceNature,@Param("spaceNatureValue") Integer spaceNatureValue,@Param("principal") Long principal,@Param("spaceProductType") Long spaceProductType);

    List<CabinetCargoSpaceVO> getEmptySpaces2(@Param("cabCodes")String[] cabCodes,@Param("spaceType") Integer spaceType,@Param("principal") Long principal,@Param("spaceProductType") Long spaceProductType,@Param("skuCode") String skuCode);

    List<CabinetCargoSpaceVO> getRecycleRepairSpaces(@Param("cabCodes")String[] cabCodes,@Param("spaceNature") Integer spaceNature,@Param("principal") Long principal,@Param("spaceProductType") Long spaceProductType);

    List<CabinetCargoSpaceVO> getSpaceByCabCode(@Param("cabCodes")String[] cabCodes);

    List<CabinetCargoSpaceVO> getUserSpaceByCabCode(@Param("cabCodes")String[] cabCodes,@Param("spaceTypes")List<Integer> spaceTypes,@Param("userId")Long userId);


    List<CabinetCargoSpaceVO> cellListLoad(@Param("page") Page<CabinetCargoSpaceVO> page, @Param("params") Map<String, Object> params);
}
